package com.redis.nxj.service.impl;

import com.redis.nxj.dao.UserDao;
import com.redis.nxj.pojo.User;
import com.redis.nxj.service.UserService;
import org.apache.ibatis.cache.Cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author ningxinjie
 * @date 2021/3/29
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    UserDao userDao;

    @Override
    public int addUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public int delUserById(Integer id) {
        return userDao.delUserById(id);
    }

    @Override
    public int updateUserById(User user) {
        return userDao.updateUserById(user);
    }

    @Override
    public List<User> queryAllUser() {
        return userDao.queryAllUser();
    }

    @Override
    public User queryUserById(Integer id) {
        return userDao.queryUserById(id);
    }
}
